package com.fp.helig;

import org.anddev.andengine.engine.Engine;
import org.anddev.andengine.engine.camera.Camera;
import org.anddev.andengine.engine.camera.SmoothCamera;
import org.anddev.andengine.engine.options.EngineOptions;
import org.anddev.andengine.engine.options.EngineOptions.ScreenOrientation;
import org.anddev.andengine.engine.options.resolutionpolicy.RatioResolutionPolicy;
import org.anddev.andengine.entity.scene.Scene;
import org.anddev.andengine.entity.scene.Scene.IOnSceneTouchListener;
import org.anddev.andengine.entity.scene.background.ColorBackground;
import org.anddev.andengine.entity.sprite.AnimatedSprite;
import org.anddev.andengine.input.touch.TouchEvent;
import org.anddev.andengine.opengl.texture.Texture;
import org.anddev.andengine.opengl.texture.TextureOptions;
import org.anddev.andengine.opengl.texture.region.TextureRegionFactory;
import org.anddev.andengine.opengl.texture.region.TiledTextureRegion;
import org.anddev.andengine.sensor.accelerometer.AccelerometerData;
import org.anddev.andengine.sensor.accelerometer.IAccelerometerListener;
import org.anddev.andengine.sensor.orientation.IOrientationListener;
import org.anddev.andengine.sensor.orientation.OrientationData;
import org.anddev.andengine.ui.activity.BaseGameActivity;

import android.content.res.Resources;
import android.util.Log;

import com.fp.helig.Res.ResManager;
import com.fp.helig.Res.Textures;
import com.fp.helig.SceneControler.Controller;
import com.fp.helig.SceneControler.Scenes.GameScene;

public class MainActivity extends BaseGameActivity{

	
	@Override
	public void onLoadComplete() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public Engine onLoadEngine() {
		// TODO Auto-generated method stub
		
		ResManager.getInstance().res= getResources();
		
		ResManager.getInstance().CAMERA_HEIGHT = ResManager.getInstance().res.getDisplayMetrics().heightPixels;
		ResManager.getInstance().CAMERA_WIDTH = ResManager.getInstance().res.getDisplayMetrics().widthPixels;
		
		ResManager.getInstance().mCamera = new SmoothCamera (0, 0, ResManager.getInstance().CAMERA_WIDTH, ResManager.getInstance().CAMERA_HEIGHT, 700, 700, 1);

		RatioResolutionPolicy Resolution = new RatioResolutionPolicy(ResManager.getInstance().CAMERA_WIDTH, ResManager.getInstance().CAMERA_HEIGHT);
		
		EngineOptions engineOptions = new EngineOptions(true, ScreenOrientation.LANDSCAPE, Resolution, ResManager.getInstance().mCamera);
		
		ResManager.getInstance().act=this;
		
		ResManager.getInstance().Curengine=new Engine(engineOptions);
		
		return ResManager.getInstance().Curengine;

	}

	@Override
	public void onLoadResources() {
		
		

	}
	
	@Override
	public Scene onLoadScene() {
		// TODO Auto-generated method stub
		
		Controller.getInstance().setControler();
	

		return Controller.getInstance().GetCurentScene();
	}


	
}
